package com.helloniu.fl.upload {

import flash.utils.ByteArray;
import com.helloniu.fl.util.Tool;

public class UploadInfo {
    public var fileMD5ID:String = null;
    public var blockInfos:Array = new Array();

    public function UploadInfo() {
    }

    public function readData(barr:ByteArray):void {
        fileMD5ID = Tool.readString(barr);

        var blocks:int = barr.readInt();
        blockInfos = new Array();

        for(var i:int = 0; i < blocks; i++) {
            var blockInfo:BlockInfo = new BlockInfo();
            blockInfo.readData(barr);
            blockInfos.push(blockInfo);
        }
    }

    public function isEmpty():Boolean {
        return fileMD5ID == null;
    }
}
}